from aiogram.filters.callback_data import CallbackData
from aiogram.types import InlineKeyboardMarkup
from aiogram.utils.keyboard import InlineKeyboardBuilder


class ConfirmCartCF(CallbackData, prefix="confirmcart"):
    promocode_id: int | None = None
    bonuses_amount: int | None = None


class CheckPaymentCF(CallbackData, prefix="check_payment"):
    payment_id: int


def get_participate_kb() -> InlineKeyboardMarkup:
    builder = InlineKeyboardBuilder()
    builder.button(text="Участвовать", callback_data="participate")

    builder.adjust(1)

    return builder.as_markup()


def get_payment_kb(payment_url: str, payment_id: int) -> InlineKeyboardMarkup:
    builder = InlineKeyboardBuilder()
    builder.button(text="Оплатить", url=payment_url)
    builder.button(text="Проверить оплату", callback_data=CheckPaymentCF(payment_id=payment_id))

    return builder.as_markup()
